/**
 * 
 */
package test.mushroomdb.index;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @author mchiodi
 *
 */
public class IndexStress {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Connection connection = null;
		try {
			Class.forName("org.mushroomdb.jdbc.DriverImpl"); //$NON-NLS-1$
			connection = DriverManager.getConnection("jdbc:mushroomdb://localhost:4444/test","mushroom","1234"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
		
		try {
			Statement statement = connection.createStatement();
			for (int i = 1; i < 100; i++) {
				statement.execute("INSERT INTO testindex (id, text) values (" +
						new Integer(i).toString() +
						",'ocho');");
			}
			connection.close();
		} catch (SQLException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

}
